f=open("shi.txt","r",encoding="utf-8")
contents = f.readlines()
print(contents)
f.close()

f=open("shi.txt","a",encoding="utf-8")
f.write("\nhello world")
f.flush()
f.close()